import Route from '@ember/routing/route';

export default Route.extend({
    model() {
        return this.store.findAll('slow-model');
    },

    actions: {
        loading(transition, originRoute) {
            let controller = this.controllerFor('foo');
            controller.set('currentlyLoading', true);


            return true; // allows the loading template to be shown
        }
        // ,
        // loading(transition, originRoute) {
        //     let controller = this.controllerFor('foo');
        //     controller.set('currentlyLoading', true);
        //     transition.promise.finally(function () {
        //         controller.set('currentlyLoading', false);
        //     });
        // }
        // ,
        // loading(transition) {
        //     let start = new Date();
        //     transition.promise.finally(() => {
        //         this.notifier.notify(`Took ${new Date() - start}ms to load`);
        //     });

        //     return true;
        // }
    }
});